﻿using System;
using System.Data;

namespace msBsc.WebUi
{
    public partial class Index3 : msBsc.Cls.BPage
    { 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            { 
                BindControls();
            }
        }

        private void BindControls()
        {
            if (!IsPostBack)
            {
            }
        }

        public string GetIndexMenu()
        {
            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder();

            System.Data.DataSet dst = null;
            using (Epm.AppLogic.Framework.CDbAccess oCDbAccess = new Epm.AppLogic.Framework.CDbAccess())
            {
                dst = oCDbAccess.QueryBySQL("SELECT LEVEL_ONE_ID,LEVEL_ONE_NME,SHOW_PAGE_URL,LEVEL_ONE_ICON FROM SHP_GOODS_TYPE_LEVEL_ONE ORDER BY SEQ_NUM");
            }

            foreach (DataRow dr in dst.Tables[0].Rows)
            {
                sbHtml.Append(@"<li class=""j_MenuNav menu-nav"" ><s class=""menu-nav-icon fp-iconfont"">"
                                + dr["LEVEL_ONE_ICON"].ToString() + @"</s><a href=""/c_GoodsSearch.htm?c1="
                                + dr["LEVEL_ONE_ID"].ToString() + @""">"
                                + dr["LEVEL_ONE_NME"].ToString() + @"</a><b class=""menu-nav-trigger j_MenuNavTrigger"">+</b> <i class=""menu-nav-arrow""></i></li>");
            }
            return sbHtml.ToString();
        }

        public string GetIndexMenu2()
        {
            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder();

            System.Data.DataSet dsLevelOne = null;
            System.Data.DataSet dsLevelTwo = null;
            System.Data.DataSet dsLevelThree = null;
            using (Epm.AppLogic.Framework.CDbAccess oCDbAccess = new Epm.AppLogic.Framework.CDbAccess())
            {
                dsLevelOne = oCDbAccess.QueryBySQL("SELECT LEVEL_ONE_ID,SEQ_NUM,SHOW_PAGE_URL,SLOGAN_BACK_IMG_COLOR,LEVEL_ONE_ICON,SLOGAN_BACK_IMG,SLOGAN_IMG,SLOGAN_IMG_LINK,SLOGAN_DESC,AD1_IMG,AD1_IMG_LINK,AD1_DESC,AD2_IMG,AD2_IMG_LINK,AD2_DESC FROM SHP_GOODS_TYPE_LEVEL_ONE ORDER BY SEQ_NUM");
                dsLevelTwo = oCDbAccess.QueryBySQL("SELECT * FROM SHP_GOODS_TYPE_LEVEL_TWO ORDER BY SEQ_NUM");
                dsLevelThree = oCDbAccess.QueryBySQL("SELECT *,GROUP_INFO=CASE WHEN ISNULL(LTRIM(GROUP_MARK),'')='' THEN '999' ELSE LTRIM(GROUP_MARK) END FROM SHP_GOODS_TYPE_LEVEL_THREE ORDER BY GROUP_MARK");
            }
            int iRows = 0;
            foreach (DataRow dr in dsLevelOne.Tables[0].Rows)
            {
                iRows++;
                sbHtml.Append(@"                        
                    <div class=""j_CategoryMenuPannel category-menu-pannel category-" + iRows.ToString() + @"-pannel hidden"" style=""display: none;"">
                        <div class=""fp-lazyload-con j_LazyloadCatgoryPannel"" style=""height: 480px;"" id=""J_LazyloadCatgoryPannel""" + dr["SEQ_NUM"].ToString() + @">
                            <div class=""module"">
                                <div class=""category-pannel-banner clearifx"" style=""background: #" + dr["SLOGAN_BACK_IMG_COLOR"].ToString() + @""">
                                    <div class=""banner-container j_BannerContainer banner-exposure"">
                                        <a href=""" + dr["SLOGAN_IMG_LINK"].ToString() + @""">
                                            <b class=""j_TextBanner text-banner"" style=""left: auto; right: 190px; background: url(" + dr["SLOGAN_IMG"].ToString() + @") no-repeat;
                                                _background: none; _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + dr["SLOGAN_IMG"].ToString() + @"'),sizingMethod='noscale';"">
                                            </b>
                                            <img class=""j_MainBanner main-banner"" src=""" + dr["SLOGAN_BACK_IMG"].ToString() + @"""
                                                width=""810"" height=""480"" alt=""" + dr["SLOGAN_DESC"].ToString() + @""">
                                        </a>
                                        <div class=""small-banner"">
                                            <a class=""j_ActLink"" href=""" + dr["AD1_IMG_LINK"].ToString() + @""">
                                                <img class=""j_ActImg"" src=""" + dr["AD1_IMG"].ToString() + @"""
                                                    data-src=""" + dr["AD1_IMG"].ToString() + @"""
                                                    width=""190"" height=""240"" alt=""" + dr["AD1_DESC"].ToString() + @""">
                                            </a><b class=""banner-separator""></b><a class=""j_ActLink"" href=""" + dr["AD2_IMG_LINK"].ToString() + @""">
                                                <img class=""j_ActImg"" src=""" + dr["AD2_IMG"].ToString() + @"""
                                                    data-src=""" + dr["AD2_IMG"].ToString() + @"""
                                                    width=""190"" height=""240"" alt=""" + dr["AD2_DESC"].ToString() + @""">
                                            </a>
                                        </div>
                                    </div>
                                </div>
                                <div class=""main-container"">
                                    <div class=""category-sub-pannel j_CategorySubPannel category-sub-pannel-opt""
                                        style=""display: none; opacity: 0.9; left: 180px;"">
                                        <b class=""sub-pannel-arrow""></b>
                                        <div class=""sub-pannel-ctn two-grid-type1"">");
                //第二层
                DataRow[] drLevelTwoRows = dsLevelTwo.Tables[0].Select("LEVEL_ONE_ID='" + dr["LEVEL_ONE_ID"].ToString() + "'", "SEQ_NUM ASC");
                foreach (DataRow drLevelTwo in drLevelTwoRows)
                {
                    sbHtml.Append(@"
                                            <div>
                                                <h3 class=""category-title " + drLevelTwo["MARK_CLASS"].ToString() + @""">
                                                    <a href=""/c_GoodsSearch.htm?c2=" + drLevelTwo["LEVEL_TWO_ID"].ToString() + @""">
                                                        " + drLevelTwo["LEVEL_TWO_NME"].ToString() + @"</a><a href=""/c_GoodsSearch.htm?c2=" + drLevelTwo["LEVEL_TWO_ID"].ToString() + @"""
                                                            class=""category-more"">更多<span class=""sub-channel-arrow fp-iconfont""></span></a></h3>");
                    //第三层
                    DataRow[] drLevelThreeRows = dsLevelThree.Tables[0].Select("LEVEL_TWO_ID='" + drLevelTwo["LEVEL_TWO_ID"].ToString() + "'", "GROUP_INFO ASC");
                    string strGropuInfo = "";
                    string strList = "";
                    for (int i = 0; i < drLevelThreeRows.Length; i++)
                    {
                        if (strGropuInfo == "")
                        {
                            strGropuInfo = drLevelThreeRows[i]["GROUP_INFO"].ToString();
                        }
                        if (strGropuInfo != drLevelThreeRows[i]["GROUP_INFO"].ToString())
                        {
                            sbHtml.Append(@"<p class=""category-label-list"">" + strList + @"</p><b class=""category-pannel-line""></b>");
                            strGropuInfo = drLevelThreeRows[i]["GROUP_INFO"].ToString();
                            strList = "";
                        }
                        else
                        {
                            strList += @"<a class=""" + (drLevelThreeRows[i]["HIGH_LIGHT"].ToString() == "True" ? "highlight" : "") + @"""  href=""/c_GoodsSearch.htm?c3=" + drLevelThreeRows[i]["LEVEL_THREE_ID"].ToString() + @""">" + drLevelThreeRows[i]["LEVEL_THREE_NME"].ToString() + @"</a>";
                        }
                        if (i == drLevelThreeRows.Length - 1)
                        {
                            sbHtml.Append(@"<p class=""category-label-list"">" + strList + @"</p>");
                            strList = "";
                        }
                    }
                    sbHtml.Append(@"</div>");
                }
                sbHtml.Append(@"</div></div></div></div></div></div>");
            }
            return sbHtml.ToString();
        }

        public string GetIndexMenu3()
        {
            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder();

            System.Data.DataSet dst = null;
            using (Epm.AppLogic.Framework.CDbAccess oCDbAccess = new Epm.AppLogic.Framework.CDbAccess())
            {
                dst = oCDbAccess.QueryBySQL("SELECT LEVEL_ONE_ID,LEVEL_ONE_NME,SHOW_PAGE_URL FROM SHP_GOODS_TYPE_LEVEL_ONE");
            }

            foreach (DataRow dr in dst.Tables[0].Rows)
            {
                sbHtml.Append(@"");
            }
            return sbHtml.ToString();
        }

        public string LoadBrandList()
        {
            if (Code.QtHtmlGet.htmlcach.ContainsKey("IndexBrandList"))
            {
                return Code.QtHtmlGet.htmlcach["IndexBrandList"].ToString();
            }
            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder(); 
            System.Data.DataSet dst = null;
            using (Epm.AppLogic.Framework.CDbAccess oCDbAccess = new Epm.AppLogic.Framework.CDbAccess())
            {
                dst = oCDbAccess.QueryBySQL(@"
    SELECT DISTINCT 
    HOT_LEVEL
    FROM SHP_GOODS_BRAND
    WHERE IS_HOT=1 AND HOT_LEVEL<>''");
                //System.Text.StringBuilder sbBrandLi = new System.Text.StringBuilder();
                System.Text.StringBuilder sbBrandLiContent = new System.Text.StringBuilder();
                sbHtml.Append(@"<ul class=""brand-rec-nav clearfix"">");
                for (int i = 0; i < dst.Tables[0].Rows.Count; i++)
                {
                    sbHtml.Append(@"<li class=""" + (i == 0 ? "selected" : (i == dst.Tables[0].Rows.Count - 1 ? "brand-rec-last-nav" : "")) + @""">" + dst.Tables[0].Rows[i]["HOT_LEVEL"].ToString() + @"</li>");
                    sbBrandLiContent.Append(@"
<li class=""brand-rec-pannel " + (i > 0 ? "hidden" : "") + @"""  style=""display: " + (i > 0 ? "none" : "block") + @";"" >
    <div class=""brand-wall-slide j_BrandWallSlide"">
        <div class=""brand-wall-content " + (i == 0 ? "" : "notloading") + @""" hot-level=""" + dst.Tables[0].Rows[i]["HOT_LEVEL"].ToString() + @""">");
                    if (i == 0)
                    {
                        //只加载第一面，后续的延迟加载
                        sbBrandLiContent.Append(LoadBrandListContent(dst.Tables[0].Rows[i]["HOT_LEVEL"].ToString(),4));
                    }
                    sbBrandLiContent.Append(@"
        </div>
        <a href=""javascript:void(0);"" target=""_self"" title=""换一批"" class=""brand-trigger-next j_BrandTriggerNext"" ><span class=""fp-iconfont""></span> 换一批</a>
    </div>
</li>");
                }
                sbHtml.Append(@"</ul><ul class=""brand-rec-content clearfix"">");
                sbHtml.Append(sbBrandLiContent);
                sbHtml.Append(@"</ul>");

            }
            Code.QtHtmlGet.htmlcach["IndexBrandList"] = sbHtml.ToString();
            return sbHtml.ToString();
        }


        private System.Text.StringBuilder LoadBrandListContent(string strLevel, int pCount)
        {
            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder(); 
            System.Data.DataSet dst = null;
            using (Epm.AppLogic.Framework.CDbAccess oCDbAccess = new Epm.AppLogic.Framework.CDbAccess())
            {
                dst = oCDbAccess.QueryBySQL(@"
	SELECT TOP " + (24 * pCount).ToString() + @"
	BRAND_ID
	,BRAND_NME=BRAND_NME+CASE WHEN ISNULL(BRAND_NME_EN,'')<>'' THEN '/'+ISNULL(BRAND_NME_EN,'') ELSE '' END
	,LOGO_IMG_URL 
	FROM SHP_GOODS_BRAND
	WHERE IS_HOT=1 AND HOT_LEVEL<>'' AND HOT_LEVEL='" + strLevel + @"'");
                int iPaddcount = 0;
                int irow = 0, icol=0;
                bool blAdd = false;
                for (int i = 0; i < dst.Tables[0].Rows.Count; i++)
                {
                    if (iPaddcount == 0)
                    {
                        sbHtml.Append(@"<p class=""brand-wall-pannel clearfix " + (blAdd ? "" : "brand-sel-pannel") + @""" style=""position: absolute; z-index: 1; opacity: 1; display: " + (blAdd ? "none" : "block") + @";"">");
                        blAdd = true;
                    }
                    sbHtml.Append(@"
    <a class="" j_BrandItem brand-item item-row-" + irow.ToString() + @" item-col-" + icol.ToString() + @"  "" href=""/c_GoodsSearch.htm?b=" + dst.Tables[0].Rows[i]["BRAND_ID"].ToString() + @""" >
        <img class=""j_BrandLogo brand-logo"" src=""" + dst.Tables[0].Rows[i]["LOGO_IMG_URL"].ToString() + @""" width=""90"" height=""45"" title=""" + dst.Tables[0].Rows[i]["BRAND_NME"].ToString() + @""" alt=""" + dst.Tables[0].Rows[i]["BRAND_NME"].ToString() + @""">
        <span class=""brand-subject-desc"" title=""""></span>
        <span class=""brand-status fp-iconfont j_BrandStatus"" ></span> 
        <span class=""brand-status-tip j_BrandStatusTip""> 关注</span> </a>");
                    iPaddcount++;
                    if (iPaddcount == 24 || i == dst.Tables[0].Rows.Count-1)
                    {
                        sbHtml.Append(@"</p>");
                        iPaddcount = 0;
                        irow = 0;
                        icol = 0;
                    }
                    icol++;
                    if (icol == 6)
                    {
                        icol = 0;
                        irow++;
                    }
                } 

            }
            return sbHtml;
        }








//        public string GetBrandList()
//        {
//            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder();

//            System.Data.DataSet dst = null;
//            using (Epm.AppLogic.Framework.CDbAccess oCDbAccess = new Epm.AppLogic.Framework.CDbAccess())
//            {
//                dst = oCDbAccess.QueryBySQL("SELECT CASE WHEN ISNULL(HOT_LEVEL,'')='' THEN '品牌' ELSE HOT_LEVEL END as HOT_LEVEL FROM SHP_GOODS_BRAND GROUP BY HOT_LEVEL");
//            }

//            sbHtml.Append(@"<div class=""brand-rec-slide"" >
//                        <ul class=""brand-rec-nav clearfix"">");
//            string strBrandLi = "";
//            string strBrandLiContent = "";
//            for (int i = 0; i < dst.Tables[0].Rows.Count; i++)
//            {
//                strBrandLi += @"<li class=""" + (i == 0 ? "selected" : (i == dst.Tables[0].Rows.Count - 1 ? "brand-rec-last-nav" : "")) + @""">" + dst.Tables[0].Rows[i]["HOT_LEVEL"].ToString() + @"</li>";
//                strBrandLiContent = @"<li class=""brand-rec-pannel"" style=""display: " + (i == 0 ? "block" : "none") + @";"">
//                                <div class=""brand-wall-slide j_BrandWallSlide"">
//                                    <div class=""brand-wall-content"">
//                                        " + this.GetBrandContent(dst.Tables[0].Rows[i]["HOT_LEVEL"].ToString()) + @"
//                                    </div>
//                                    <a href=""javascript:void(0);"" target=""_self"" title=""换一批"" class=""brand-trigger-next j_BrandTriggerNext"">
//                                        <span class=""fp-iconfont""></span>换一批</a><ul class=""tab-nav"" style=""display: none"">
//                                            <li class=""selected""><a href=""javascript:void(0);"">1</a></li><li class=""""><a href=""javascript:void(0);"">
//                                                2</a></li><li class=""""><a href=""javascript:void(0);"">3</a></li><li class=""""><a href=""javascript:void(0);"">
//                                                    4</a></li></ul>
//                                </div>
//                            </li>";
//            }
//            sbHtml.Append(strBrandLi + @"</ul><ul class=""brand-rec-content clearfix"">" + strBrandLiContent + @"</ul>
//                        <div>
//                            <a class=""brand-pool"" href=""/c_GoodsSearch.htm?c2="">品牌库 <span class=""fp-iconfont""></span></a></div>
//                    </div>");
//            return sbHtml.ToString();
//        }

//        private string GetBrandContent(string strHotLevel)
//        {
//            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder();

//            System.Data.DataSet dst = null;
//            using (Epm.AppLogic.Framework.CDbAccess oCDbAccess = new Epm.AppLogic.Framework.CDbAccess())
//            {
//                dst = oCDbAccess.QueryBySQL("SELECT * FROM SHP_GOODS_BRAND WHERE (CASE WHEN ISNULL(HOT_LEVEL,'')='' THEN '品牌' ELSE HOT_LEVEL END)='" + strHotLevel + "'");
//            }
//            int iTotalCount = dst.Tables[0].Rows.Count;
//            int iRowItemCount = 6;//一行中最大允许数量
//            int iColumnTotalCount = 3;//最大允许列数0-3
//            int iColumnCount = 0;
//            int iRowCount = 0;
//            string strList = "";
//            for (int i = 0; i < iTotalCount; i++)
//            {
//                if (i % iRowItemCount == 0 && i > 0)
//                {
//                    iColumnCount++;
//                    iRowCount = 0;
//                }

//                if (iColumnCount > iColumnTotalCount)
//                {
//                    iColumnCount = 0;
//                    iRowCount = 0;

//                    sbHtml.Append(@"<p class=""brand-wall-pannel clearfix"" style=""position: absolute; z-index: 0; opacity: 1;
//                                            display: " + (i > 24 ? "none" : "block") + @";"">" + strList + @"</p>");

//                    strList = @"<a class=""j_BrandItem brand-item item-row-" + iColumnCount.ToString() + @" item-col-" + iRowCount.ToString() + @""" href=""" + dst.Tables[0].Rows[i]["SHOW_PAGE_URL"].ToString() + @""">
//                                                <img class=""j_BrandLogo brand-logo"" src=""" + dst.Tables[0].Rows[i]["LOGO_IMG_URL"].ToString() + @"""
//                                                    width=""90"" height=""45"" title=""" + dst.Tables[0].Rows[i]["BRAND_NME"].ToString() + @""" alt=""" + dst.Tables[0].Rows[i]["BRAND_NME"].ToString() + @""">
//                                                <span class=""brand-subject-desc"" title=""""></span><span class=""brand-status fp-iconfont j_BrandStatus""
//                                                    ></span> <span class=""brand-status-tip j_BrandStatusTip"">
//                                                        关注</span> </a>";
//                }
//                else
//                {
//                    strList += @"<a class=""j_BrandItem brand-item item-row-" + iColumnCount.ToString() + @" item-col-" + iRowCount.ToString() + @""" href=""" + dst.Tables[0].Rows[i]["SHOW_PAGE_URL"].ToString() + @""">
//                                                <img class=""j_BrandLogo brand-logo"" src=""" + dst.Tables[0].Rows[i]["LOGO_IMG_URL"].ToString() + @"""
//                                                    width=""90"" height=""45"" title=""" + dst.Tables[0].Rows[i]["BRAND_NME"].ToString() + @""" alt=""" + dst.Tables[0].Rows[i]["BRAND_NME"].ToString() + @""">
//                                                <span class=""brand-subject-desc"" title=""""></span><span class=""brand-status fp-iconfont j_BrandStatus""
//                                                    ></span> <span class=""brand-status-tip j_BrandStatusTip"">
//                                                        关注</span> </a>";
//                }

//                if (i == iTotalCount - 1)
//                {
//                    sbHtml.Append(@"<p class=""brand-wall-pannel clearfix"" style=""position: absolute; z-index: 0; opacity: 1;
//                                            display: " + (i > 24 ? "none" : "block") + @";"">" + strList + @"</p>");
//                }
//                iRowCount++;
//            }
//            return sbHtml.ToString();
//        }

        public string GetFloor()
        {
            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder();

            System.Data.DataSet dsFloor = null;
            System.Data.DataSet dsLevelOne = null;
            System.Data.DataSet dsLevelThree = null;
            using (Epm.AppLogic.Framework.CDbAccess oCDbAccess = new Epm.AppLogic.Framework.CDbAccess())
            {
                dsFloor = oCDbAccess.QueryBySQL("SELECT DISTINCT A.* FROM SHP_GOODS_FLOOR A INNER JOIN SHP_GOODS_TYPE_LEVEL_ONE B ON A.FLOOR_ID = B.FLOOR_ID ORDER BY SEQ_NUM");
                dsLevelOne = oCDbAccess.QueryBySQL("SELECT * FROM SHP_GOODS_TYPE_LEVEL_ONE ORDER BY SEQ_NUM");
                dsLevelThree = oCDbAccess.QueryBySQL("SELECT * FROM ("
                                                        + " SELECT FLOOR_ID,LEVEL_THREE_ID,LEVEL_THREE_NME,SHOW_PAGE_URL,FLOOR_NUM = ROW_NUMBER() OVER( PARTITION BY FLOOR_ID ORDER BY GOODS_NUM) FROM("
                                                            + " SELECT B.FLOOR_ID, D.LEVEL_THREE_ID,D.LEVEL_THREE_NME,D.SHOW_PAGE_URL,ROW_NUMBER() OVER( PARTITION BY B.FLOOR_ID,D.LEVEL_TWO_ID ORDER BY D.LEVEL_THREE_NME) AS GOODS_NUM FROM SHP_GOODS_FLOOR A "
                                                            + " INNER JOIN SHP_GOODS_TYPE_LEVEL_ONE B ON A.FLOOR_ID = B.FLOOR_ID"
                                                            + " INNER JOIN SHP_GOODS_TYPE_LEVEL_TWO C ON B.LEVEL_ONE_ID = C.LEVEL_ONE_ID"
                                                            + " INNER JOIN SHP_GOODS_TYPE_LEVEL_THREE D ON D.LEVEL_TWO_ID = C.LEVEL_TWO_ID) E"
                                                            + " WHERE E.GOODS_NUM < 21) F WHERE FLOOR_NUM < 21");
            }

            foreach (DataRow dr in dsFloor.Tables[0].Rows)
            {
                if (!string.IsNullOrEmpty(dr["FLOOR_TOP_AD_IMG"].ToString()))
                {
                    sbHtml.Append(@"<div class=""main-container"">
                        <div class=""fp-lazyload-con j_LazyloadCon"" style=""height: 120px;"">
                            <div class=""floor-ad-banner"">
                                <ins style=""display: inline-block; padding: 0; margin: 0; width: 1190px; height: 90px;
                                    *zoom: 1; *display: inline"" ><a
                                        href=""" + dr["FLOOR_TOP_AD_LINK"].ToString() + @"""
                                        target=""_blank"">
                                        <img border=""0"" src=""" + dr["FLOOR_TOP_AD_IMG"].ToString() + @"""
                                            width=""1190px"" height=""90px""></a></ins><a style=""display: none!important""></a>
                            </div>
                        </div>
                    </div>");
                }

                sbHtml.Append(@"<div class=""main-container"">
                <div class=""j_FloorItem floor-item"">
                    <div class=""fp-lazyload-con j_LazyloadCon mui-lift-cur-pannel"" style=""height: 452px;"" >
                        <div class=""module"">
                            <div  class=""fp-floor " + GetFloorCss(dr["SEQ_NUM"].ToString()) + @""">
                                <div class=""floor-content"">
                                    <div class=""grid-col-191 floor-show"">
                                        <ul class=""floor-show-top floor-title"">");



                    //sbHtml.Append(@"<li><a href=""/c_GoodsSearch.htm?c1="
                    //    + dr["MAIN_GOODS_NME"].ToString() + @"""><span class=""floor-icon fp-iconfont"">"
                    //    + "㑙" + @"</span> <span class=""floor-key"">"
                    //    + dr["MAIN_GOODS_NME"].ToString() + @"</span> </a></li>");


                    DataRow[] drLevelOne = dsLevelOne.Tables[0].Select("FLOOR_ID='" + dr["FLOOR_ID"].ToString() + "'");
                    for (int i = 0; i < drLevelOne.Length && i < 2; i++)
                    {
                        sbHtml.Append(@"<li><a href=""/c_GoodsSearch.htm?c1="
                            + drLevelOne[i]["LEVEL_ONE_ID"].ToString() + @"""><span class=""floor-icon fp-iconfont"">"
                            + drLevelOne[i]["LEVEL_ONE_ICON"].ToString() + @"</span> <span class=""floor-key"">"
                            + drLevelOne[i]["LEVEL_ONE_NME"].ToString().Substring(0,2) + @"</span> </a></li>");
                        if (drLevelOne.Length > 1 && i == 0)
                        {
                            sbHtml.Append(@"<li><b class=""floor-title-separator""></b></li>");
                        }
                    }

                sbHtml.Append(@"</ul>
                                        <div>
                                            <div class=""floor-show-middle"">
                                                <ul class=""floor-label-list"">");
                DataRow[] drLevelThree = dsLevelThree.Tables[0].Select("FLOOR_ID='" + dr["FLOOR_ID"].ToString() + "'");
                for (int i = 0; i < drLevelThree.Length && i < 12; i++)
                {
                    sbHtml.Append(@"<li><a href=""/c_GoodsSearch.htm?c3="
                        + drLevelThree[i]["LEVEL_THREE_ID"].ToString() + @""">"
                        + drLevelThree[i]["LEVEL_THREE_NME"].ToString() + @"</a>");
                    i++;
                    if (i < drLevelThree.Length && i < 12)
                    {
                        sbHtml.Append(@"<a href=""/c_GoodsSearch.htm?c3="
                        + drLevelThree[i]["LEVEL_THREE_ID"].ToString() + @""">"
                        + drLevelThree[i]["LEVEL_THREE_NME"].ToString() + @"</a></li>");
                    }
                    else
                    {
                        sbHtml.Append(@"</li>");
                    }

                }
                sbHtml.Append(@"</ul>
                                            </div>
                                            <div class=""floor-show-bottom"">
                                                <ul class=""floor-label-list"">");
                for (int i = 12; i < drLevelThree.Length && i < 21; i++)
                {
                    sbHtml.Append(@"<li><a href=""/c_GoodsSearch.htm?c3="
                        + drLevelThree[i]["LEVEL_THREE_ID"].ToString() + @""">"
                        + drLevelThree[i]["LEVEL_THREE_NME"].ToString() + @"</a>");
                    i++;
                    if (i < drLevelThree.Length && i < 21)
                    {
                        sbHtml.Append(@"<a href=""/c_GoodsSearch.htm?c3="
                        + drLevelThree[i]["LEVEL_THREE_ID"].ToString() + @""">"
                        + drLevelThree[i]["LEVEL_THREE_NME"].ToString() + @"</a></li>");
                    }
                    else
                    {
                        sbHtml.Append(@"</li>");
                    }
                }
                sbHtml.Append(@"</ul>
                                            </div>
                                        </div>
                                    </div>
                                    <div class=""floor-banner-container"">
                                        <div class=""grid-col-400"">
                                            <a class=""grid-row-422 floor-banner"" href=""" + dr["FLOOR_BOTTOM_AD_LINK"].ToString() + @""">
                                                <img src=""" + dr["FLOOR_BOTTOM_AD_IMG"].ToString() + @"""
                                                    width=""400"" height=""422"">
                                            </a>
                                        </div>
                                        <div class=""grid-col-199"">
                                            <a class=""grid-row-255 floor-banner j_ActLink"" href="""">
                                                <img class=""j_ActImg j_NeedHD"" src=""http://gtms03.alicdn.com/tps/i3/TB1RAcjGpXXXXbsXpXX6Cwu2XXX-398-510.jpg_q60.jpg""
                                                    width=""199"" height=""255"">
                                            </a><a class=""grid-row-166 floor-banner j_ActLink"" href="""">
                                                <img class=""j_ActImg j_NeedHD""
                                                    src=""http://gtms04.alicdn.com/tps/i4/TB1vf.nGpXXXXbLXpXXz87X2XXX-398-332.jpg_q60.jpg""
                                                    width=""199"" height=""166"">
                                            </a>
                                        </div>
                                        <div class=""grid-col-199 hidden-in-990"">
                                            <a class=""grid-row-255 floor-banner j_ActLink"" href="""">
                                                <img class=""j_ActImg j_NeedHD"" data-src=""""
                                                    src=""http://gtms02.alicdn.com/tps/i2/TB1DGdnGpXXXXaoXpXX6Cwu2XXX-398-510.jpg_q60.jpg""
                                                    width=""199"" height=""255"">
                                            </a><a class=""grid-row-166 floor-banner j_ActLink"" href="""">
                                                <img class=""j_ActImg j_NeedHD""
                                                    src=""http://gtms03.alicdn.com/tps/i3/TB1Yy0hGpXXXXXaXFXXz87X2XXX-398-332.jpg_q60.jpg""
                                                    width=""199"" height=""166"">
                                            </a>
                                        </div>
                                        <div class=""grid-col-199"">
                                            <a class=""grid-row-255 floor-banner j_ActLink"" href="""">
                                                <img class=""j_ActImg j_NeedHD""
                                                    src=""http://gtms02.alicdn.com/tps/i2/TB1tzcvGpXXXXarXFXX6Cwu2XXX-398-510.jpg_q60.jpg""
                                                    width=""199"" height=""255"">
                                            </a><a class=""grid-row-166 floor-banner j_ActLink"" href="""">
                                                <img class=""j_ActImg j_NeedHD""
                                                    src=""http://gtms01.alicdn.com/tps/i1/TB1Xw2gGpXXXXXgXXXXz87X2XXX-398-332.jpg_q60.jpg""
                                                    width=""199"" height=""166"">
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>");
            }
            return sbHtml.ToString();
        }

        private string GetFloorCss(string strFloorNum)
        {
            string strCss = "";
            switch (strFloorNum)
            {
                case "1":
                    strCss = "fp-floor-nvz";
                    break;
                case "2":
                    strCss = "fp-floor-mz";
                    break;
                case "3":
                    strCss = "fp-floor-nz";
                    break;
                case "4":
                    strCss = "fp-floor-xb";
                    break;
                case "5":
                    strCss = "fp-floor-yd";
                    break;
                case "6":
                    strCss = "fp-floor-sj";
                    break;
                case "7":
                    strCss = "fp-floor-dq";
                    break;
                case "8":
                    strCss = "fp-floor-my";
                    break;
                case "9":
                    strCss = "fp-floor-sp";
                    break;
                case "10":
                    strCss = "fp-floor-ts";
                    break;
                case "11":
                    strCss = "fp-floor-jz";
                    break;
                case "12":
                    strCss = "fp-floor-cs";
                    break;
            }
            return strCss;
        }

        public override void DoAction()
        {
            if (this.strAction == "loadBrandlistdata")
            {
                this.ExecJScript("loadSetBrand('" + this.GetParamHtValue("HOT_LEVEL") + "','" + msBsc.AppLogic.Cfg.HttpTools.stringToJson(LoadBrandListContent(this.GetParamHtValue("HOT_LEVEL"), 4).ToString()) + "');");
            }
        }
    }
}